import time

# 当前的时间戳
print("当前的时间戳", time.time())
# 指定时间戳获取本地的对象
t1 = time.localtime(60)
print(t1)
t2 = time.ctime(60)
print(t2)
# 获取当前的本地时间
current_time = time.localtime()
print(current_time)

print("年", current_time.tm_year)
print("月", current_time.tm_mon)
print("日", current_time.tm_mday)
print("时", current_time.tm_hour)
print("分", current_time.tm_min)
print("秒", current_time.tm_sec)
print("星期", current_time.tm_wday + 1)
print("一年的多少天", current_time.tm_yday)

print(time.strftime("%Y-%m-%d %H:%M:%S", current_time))

print(time.strptime("2008-08-09", "%Y-%m-%d"))
# 英文的星期多少
print(time.strftime("%A", time.strptime("2024-06-16", "%Y-%m-%d")))
# 英文的第几个月
print(time.strftime("%B", time.strptime("2024-06-16", "%Y-%m-%d")))
